<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>业务量统计明细</title>
    <s:head/>
</head>
<script type="text/javascript">
    var formSetting = {
        title: "业务量统计明细",
        module: 'save',
        numCount: '2',
        columns: [
            {
                index: "owner",
                name: "fundReport.owner.name",
                readonly: true,
                hidden: true,
                label: "供应商名称"
            },
            {
                index: "preRegDate",
                name: "fundReport.preRegDate",
                readonly: true,
                label: "统计起始时间"
            },
            {
                index: "regDate",
                name: "fundReport.regDate",
                readonly: true,
                label: "统计结束时间"
            }
        ],
        form: {
            'url': '',
            'data': function () {
                var id = "${id}";
                if (id) {
                    var dataValue = "";
                    $.ajax({
                        url: "report-find?fundReport.id="
                        + id,
                        async: false,
                        cache: false,
                        success: function (data) {
                            dataValue = data;
                        }
                    });
                    return dataValue;
                } else {
                    return null;
                }
            },
            'afterAjaxSuccess': function (responseText, statusText, xhr, $form) {
            }
        },
        buttons: {
            custom: [{
                id: "back",
                value: "返回",
                click: function () {
                    history.back();
                }
            }]
        },
        grid: {
            id: "dataGrid",
            title: "查询结果，总业务量(${totalBizCount})",
            url: "report-findCustomerBizReport?fundReport.id=${id}",
            colModel: [{
                index: "COM_NAME",
                name: "com_name",
                label: "客户公司名称"
            }, {
                index: "AMOUNT",
                name: "amount",
                label: "业务量"
            }, {
                index: "FUNDAMOUNT",
                name: "fundAmount",
                label: "预付款"
            }],
            sortname: "",
            rowNum: 100,
            jsonReader: {
                root: "customerBizReports"
            }
        }
    };
    $(document).ready(function () {
        $("#formtable").mrdForm(formSetting);
        $("#saveButton").hide();
    });
</script>
<body>
<div style="width: 100%">
    <div id="formtable"></div>
</div>
</body>
</html>
